package com.atung.parking.request.save;

import com.atung.parking.enums.ApplicableScopeType;
import com.atung.parking.enums.ParkingPackageType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author Administrator
 */
@Data
public class SaveOrUpdateParkingPackageRequest implements Serializable {


    @ApiModelProperty("套餐编号")
    private Long id;
    @ApiModelProperty("停车场编号")
    @NotNull(message = "停车场编号不能为空")
    private Long parkingIotId;

    @ApiModelProperty("套餐类型")
    private ParkingPackageType packageType;

    @ApiModelProperty("开始时间")
    @Pattern(regexp = "^([01]?[0-9]|2[0-3]):[0-5][0-9]$", message = "时间格式不正确，应为HH:mm")
    private String validPeriodStart;

    @ApiModelProperty("截止时间")
    @Pattern(regexp = "^([01]?[0-9]|2[0-3]):[0-5][0-9]$", message = "时间格式不正确，应为HH:mm")
    private String validPeriodEnd;

    @ApiModelProperty("使用范围")
    private ApplicableScopeType applicableScope;


    @ApiModelProperty("套餐价格")
    @DecimalMin(value = "0.01", message = "套餐价格必须大于0")
    private BigDecimal packagePrice;

    @ApiModelProperty("套餐原价")
    @DecimalMin(value = "0.01", message = "套餐原价必须大于0")
    private BigDecimal originalPrice;

    @ApiModelProperty("套餐数据")
    @Min(value = 1)
    private Integer stock;
}
